'*******************************************************************************
' *  
' *  Product: GSALib
' *  Description: A C# API for accessing the Google Search Appliance.
' *
' *  (c) Copyright 2008 Michael Cizmar + Associates Ltd.  (MC+A)
' *  
'*******************************************************************************


Imports System
Imports System.Collections.Generic
Imports System.Text

Namespace GSALib.Constants
    ''' <summary>
    ''' Class provides Methods/Members to set Output format supported by GSA
    ''' <para>Author Albert Ghukasyan</para>    
    ''' </summary>
    Public NotInheritable Class Output
#Region "Variables"

        ''' <summary>
        ''' "XML" Format Output  (with DTD)
        ''' </summary>
        Public Shared XML As New Output("xml")

        ''' <summary>
        ''' "HTML Custom Output" Format or XML Output format (without DTD)
        ''' </summary>
        Public Shared XML_NO_DTD As New Output("xml_no_dtd")

        Private value As String

#End Region

#Region "Constructor"

        Private Sub New(ByVal value As String)
            Me.value = IIf((value Is Nothing), "", value)
        End Sub

#End Region

#Region "Methods"

        Public Function hashCode() As Integer
            Return IIf((value Is Nothing), 0, value.GetHashCode())
        End Function

        Public Function equals(ByVal o As Object) As Boolean
            Dim retval As Boolean = False
            If o IsNot Nothing AndAlso TypeOf o Is Output Then
                Dim other As Output = DirectCast(o, Output)
                retval = other.value.Equals(Me.value)
            End If
            Return retval
        End Function

        Public Function getValue() As String
            Return value
        End Function

#End Region
    End Class
End Namespace
